StopAxis
命令控制的运动站和将轴设置至停止 (Stopping) 状态,其中断所有正在执行中的函式,当轴在停止状态时,其他函式将无法移动轴,当轴到达速度零时,Done
与 KsCommandStatus 栏位将立即设为 TRUE。欲离开停止状态并前往静止 (Standstill) 状态,请使用 ReleaseAxis。
语法
KsCommandStatus StopAxis(
int Index,
double Deceleration,
double Jerk
);
参数
Index [in]:轴索引。索引以零为起点;别名将影响此参数。
Deceleration [in]:减速度值,单位由 McProfileType 类型决定,为 [单位/秒2] 或 [秒]。
Jerk [in]:加加速度值,单位由 McProfileType 类型决定,为 [单位/秒3] 或 [秒]。
回传值
返回 KsCommandStatus 结构。
备注
- 使轴以指定的速度减速直到停止。
- 此功能主要用于紧急停止或特殊情况。
- 若 Deceleration = 0,则函式的行为是实施限定 (implementation-specific) 的。
- 只有 PowerAxis 和 ReleaseAxis 可中止 StopAxis。
范例
VOID Lock(INT Index) {
//StopAxis will halt and lock the axis preventing any other move to run
KsCommandStatus status = WaitForCommand(5, FALSE, StopAxis(Index, 36000, 3600000));
//The axis is now locked. The state is axisLocked.
AxisState state = axisOffline;
KsError nRet = GetAxisState(Index, &state);
RtPrintf("Current State: %d\n", state);
//Unlock the axis
status = AbortCommand(status);
}
使用需求
RT | Win32 | |
---|---|---|
最低支援版本 | 4.0 | 4.0 |
标头档 | ksmotion.h | ksmotion.h |
程式库 | KsApi_Rtss.lib | KsApi.lib |
参见